var citys = [
  {
    id: 1,
    name: '北京'
  },
  {
    id: 2,
    name: '上海'
  }
]
var newNodes = []
citys.forEach(
  item => newNodes.push({ value: item.id, lable: item.name, leaf: false })
)
console.log(newNodes)
// [{ value: 1, label: '北京', leaf: false }, { value: 2, label: '上海', leaf: false }]

// nodes levle:0

// let is_leaf = nodes.level === 1 ? true : false

// 北京 level:1, leaf:is_leaf

// let is_leaf = nodes.level === 1 ? true : false

// 东城区 level: 2, leaf:is_leaf
